import { RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: 'main'
    },
    {
        path: '/main',
        name: 'main',
        meta: {
            title: '主页'
        },
        component: () => import('../views/main/index.vue'),
        children: [
            {
                path: '/main',
                redirect: '/main/home'
            },
            {
                path: 'home',
                name: 'home',
                meta: {
                    title: '主页'
                },
                component: () => import('../views/main/home/index.vue'),
            },
           
            {
                path: 'about',
                name: 'about',
                meta: {
                    title: '关于'
                },
                component: () => import('../views/main/about/index.vue'),
            },
            {
                path: 'confession',
                name: 'confession',
                meta: {
                    title: '表白'
                },
                component: () => import('../views/main/confession/index.vue'),
            },
            {
                path: 'photo',
                name: 'photo',
                meta: {
                    title: '相册'
                },
                component: () => import('../views/main/photo/index.vue'),
            },
            {
                path: 'matter',
                name: 'matter',  //命名路由 要和path 保持一致
                meta: {
                    title: '100件事'
                },
                component: () => import('../views/main/matter/index.vue'),
            }, 
            {
                path: 'classifys',
                name: 'classifys',
                meta: {
                    title: '相册'
                },
                component: () => import('../views/main/classifys/index.vue'),
            },
            {
                path: 'classify/:id',
                name: 'classify',
                meta: {
                    title: '文章列表'
                },
                component: () => import('../views/main/classify/index.vue'),
            },
            {
                path: 'details/:id',
                name: 'details',
                meta: {
                    title: '文章详情'
                },
                component: () => import('../views/main/details/index.vue'),
            },
        ]

    },
]

export default routes